﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="Cart.aspx.cs" Inherits="GalaxySale2014.WebForm2" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <link href="CSS/Site.Master.css" rel="stylesheet" />
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <table class="tableOrderInfo">
        <tr>
            <td class="tdOrderInfoLabel">
                <asp:Label ID="LabelFirstName" runat="server" Text="First Name :" CssClass="labelOrderInfo"></asp:Label>
            </td>
            <td>
                <asp:TextBox ID="TextBoxFirstName" runat="server" CssClass="textBoxOrderInfo"></asp:TextBox>
                <asp:RequiredFieldValidator ID="RequiredFieldValidatorFirstName" runat="server" ControlToValidate="TextBoxFirstName" ErrorMessage="Enter First Name" CssClass="requiredFieldValidator">*</asp:RequiredFieldValidator>
            </td>
        </tr>
        <tr>
            <td class="tdOrderInfoLabel">
                <asp:Label ID="LabelLastName" runat="server" Text="Last Name :" CssClass="labelOrderInfo"></asp:Label>
            </td>
            <td>
                <asp:TextBox ID="TextBoxLastName" runat="server" CssClass="textBoxOrderInfo"></asp:TextBox>
                <asp:RequiredFieldValidator ID="RequiredFieldValidatorLastName" runat="server" ControlToValidate="TextBoxLastName" ErrorMessage="Enter Last Name" CssClass="requiredFieldValidator">*</asp:RequiredFieldValidator>
            </td>
        </tr>
        <tr>
            <td class="tdOrderInfoLabel">
                <asp:Label ID="LabelAddress" runat="server" Text="Address :" CssClass="labelOrderInfo"></asp:Label>
            </td>
            <td>
                <asp:TextBox ID="TextBoxAddress" runat="server" CssClass="textBoxOrderInfo"></asp:TextBox>
                <asp:RequiredFieldValidator ID="RequiredFieldValidatorAddress" runat="server" ControlToValidate="TextBoxAddress" ErrorMessage="Enter Address" CssClass="requiredFieldValidator">*</asp:RequiredFieldValidator>
            </td>
        </tr>
        <tr>
            <td class="tdOrderInfoLabel">
                <asp:Label ID="LabelZip" runat="server" Text="Zip :" CssClass="labelOrderInfo"></asp:Label>
            </td>
            <td>
                <asp:TextBox ID="TextBoxZip" runat="server" CssClass="textBoxOrderInfo"></asp:TextBox>
                <asp:RequiredFieldValidator ID="RequiredFieldValidatorZip" runat="server" ControlToValidate="TextBoxZip" ErrorMessage="Enter ZipCode" CssClass="requiredFieldValidator">*</asp:RequiredFieldValidator>
                <asp:RegularExpressionValidator ID="RegularExpressionValidatorZip" runat="server" ControlToValidate="TextBoxZip" ErrorMessage="Invalid ZipCode" ValidationExpression="\d{5}|\d{3} \d{2}">*</asp:RegularExpressionValidator>
            </td>
        </tr>
        <tr>
            <td class="tdOrderInfoLabel">
                <asp:Label ID="LabelCity" runat="server" Text="City :" CssClass="labelOrderInfo"></asp:Label>
            </td>
            <td>
                <asp:TextBox ID="TextBoxCity" runat="server" CssClass="textBoxOrderInfo"></asp:TextBox>
                <asp:RequiredFieldValidator ID="RequiredFieldValidatorCity" runat="server" ControlToValidate="TextBoxCity" ErrorMessage="Enter City" CssClass="requiredFieldValidator">*</asp:RequiredFieldValidator>
            </td>
        </tr>
        <tr>
            <td class="tdOrderInfoLabel">
                <asp:Label ID="LabelEmail" runat="server" Text="Email :" CssClass="labelOrderInfo"></asp:Label>
            </td>
            <td>
                <asp:TextBox ID="TextBoxEmail" runat="server" TextMode="Email" CssClass="textBoxOrderInfo"></asp:TextBox>
                <asp:RequiredFieldValidator ID="RequiredFieldValidatorEmail" runat="server" ControlToValidate="TextBoxEmail" ErrorMessage="Enter Email" CssClass="requiredFieldValidator">*</asp:RequiredFieldValidator>
                <asp:RegularExpressionValidator ID="RegularExpressionValidatorEmail" runat="server" ControlToValidate="TextBoxEmail" ErrorMessage="Invalid Email" ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*">*</asp:RegularExpressionValidator>
            </td>
        </tr>
    </table>
    <asp:ValidationSummary ID="ValidationSummary1" runat="server" CssClass="validationOrderInfo" />
    <br />
    <asp:Label ID="LabelOrderRows" runat="server" Text="Overview:"></asp:Label>
    <br />
    <asp:GridView ID="GridViewOverview" runat="server" AutoGenerateColumns="False" OnRowCommand="GridViewOverview_RowCommand" CssClass="gridViewArticles">
        <Columns>
            <asp:BoundField HeaderText="Article Id" DataField="Article.ArticleId" />
            <asp:BoundField HeaderText="Article Name" DataField="Article.ArticleName" />
            <asp:BoundField HeaderText="Unit Price" DataField="Article.UnitPrice" DataFormatString="{0:c0}" />
            <asp:TemplateField HeaderText="Quantity">
                <ItemTemplate>
                    <asp:TextBox ID="TextBoxQ" runat="server" TextMode="Number" OnTextChanged="TextBoxQ_TextChanged" CssClass="textBoxQ"></asp:TextBox>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:BoundField HeaderText="Sum" DataField="Sum" DataFormatString="{0:c0}" />
            <asp:ButtonField ButtonType="Button" CommandName="Delete" Text="Delete" />
        </Columns>
    </asp:GridView>
    <div class="labelTotalSum">
        <asp:Label ID="LabelCartTotalSum" runat="server"></asp:Label>
    </div>
    <br />
    <asp:Button ID="ButtonSaveOrder" runat="server" OnClick="ButtonSaveOrder_Click" Text="Save Order" />
</asp:Content>
